home *** CD-ROM | disk | FTP | other *** search
- on disablePeekAlert
- global gPeekAlertEnabled
- set gPeekAlertEnabled to 0
- end
-
- on enablePeekAlert
- global gPeekAlertEnabled
- set gPeekAlertEnabled to 1
- end
-
- on clearTheStage
- global oPuppeteer
- repeat with i = 1 to 43
- puppetSprite(i, 0)
- end repeat
- updateStage()
- end
-
- on setPKScanStatus suggestion
- global oStoryteller, oPuppeteer, gScanFinish
- set validList to [#Offline, #CantAttach, #Online, #NoResidue, #Wait5min, #Wait4min, #Wait3min, #Wait2min, #Wait1min, #ReadyForPlayback, #Interrupted, #Preamble]
- if not getPos(validList, suggestion) then
- alert("Can't set #PKscanStatus to " & suggestion)
- exit
- end if
- set currentStatus to getState(oStoryteller, #PKscanStatus)
- if suggestion = #Online then
- if getPos([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], currentStatus) then
- set gScanFinish to 0
- set suggestion to #Interrupted
- end if
- if currentStatus = #ReadyForPlayback then
- set suggestion to #ReadyForPlayback
- end if
- end if
- if suggestion = #Offline then
- set gScanFinish to 0
- end if
- if currentStatus = #ReadyForPlayback then
- if suggestion <> #ReadyForPlayback then
- setState(oStoryteller, #PeekDisplay, #None)
- end if
- if getPos([#Wait5min, #Wait4min, #Wait3min, #Wait2min, #Wait1min], suggestion) then
- setState(oStoryteller, #PeekDisplay, #goodScan5min)
- else
- end if
- end if
- setProp(the lsStateData of oStoryteller, #PKscanStatus, [suggestion])
- if (suggestion = #Interrupted) and (getState(oStoryteller, #playerHasPeekUnit) = #carrying) then
- setState(oStoryteller, #PeekDisplay, #interruptedScan)
- peekAlert()
- end if
- if the castNum of sprite 41 = getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 4) then
- set the castNum of sprite 40 to getProp(getProp(the lsMultiframes of oPuppeteer, #peekText), value("#scan" & suggestion))
- end if
- end
-
- on setPKbarStatus suggestion
- global oStoryteller, oPuppeteer
- set validList to [#Offline, #Online, #noActivity, #ActivityDetected]
- if not getPos(validList, suggestion) then
- alert("Can't set #PKbarStatus to " & suggestion)
- exit
- end if
- setProp(the lsStateData of oStoryteller, #PKbarStatus, [suggestion])
- if the castNum of sprite 42 = getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 4) then
- set the castNum of sprite 40 to getProp(getProp(the lsMultiframes of oPuppeteer, #peekText), value("#bar" & suggestion))
- end if
- end
-
- on setPKamberStatus suggestion
- global oStoryteller, oPuppeteer
- set validList to [#Incomplete, #Online, #WaveButIncomplete, #WaveActivated, #ModulatingEEG, #OneMoment, #surfsUp]
- if not getPos(validList, suggestion) then
- alert("Can't set #PKamberStatus to " & suggestion)
- exit
- end if
- if suggestion = #Online then
- if getState(oStoryteller, #psionicWavesPresent) then
- set suggestion to #WaveActivated
- else
- set suggestion to #Online
- end if
- end if
- if suggestion = #WaveActivated then
- if getState(oStoryteller, #oscillatorInPlace) then
- set suggestion to #WaveActivated
- else
- set suggestion to #WaveButIncomplete
- end if
- end if
- setProp(the lsStateData of oStoryteller, #PKamberStatus, [suggestion])
- if the castNum of sprite 43 = getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 4) then
- set the castNum of sprite 40 to getProp(getProp(the lsMultiframes of oPuppeteer, #peekText), value("#amber" & suggestion))
- end if
- end
-
- on usePeekUnit
- global oStoryteller, oPuppeteer, gPeekPlayList, gScanFinish, gOriginPoint, gCPU
- setState(oStoryteller, #playerHasPeekUnit, #inUse)
- killVideo()
- updateStage()
- idle()
- cursorOff()
- set peekBody to 38
- set peekAntenna to 46
- set peekRollUp to 44
- set peekText to 40
- set pkScanIcon to 41
- set pkBarIcon to 42
- set pkAmberIcon to 43
- set buttonCoords to point(247, 270) + gOriginPoint
- set textList to getProp(the lsMultiframes of oPuppeteer, #peekText)
- puppetSprite(peekBody, 1)
- set the stretch of sprite peekBody to 0
- set the ink of sprite peekBody to 8
- set the castNum of sprite peekBody to getProp(the lsForegroundData of oPuppeteer, #PeekDown)
- set the loc of sprite peekBody to point(320, 200) + gOriginPoint
- puppetSprite(peekAntenna, 1)
- set the stretch of sprite peekAntenna to 0
- set the ink of sprite peekAntenna to 36
- set the castNum of sprite peekAntenna to getProp(the lsForegroundData of oPuppeteer, #peekAntenna)
- set the loc of sprite peekAntenna to point(320, 200) + gOriginPoint
- set peekAnim to getProp(the lsForegroundData of oPuppeteer, #PeekUpAnim)
- set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
- puppetSprite(peekRollUp, 1)
- set the movieRate of sprite peekRollUp to 0
- set the movieTime of sprite peekRollUp to 0
- set slideVolume to the volume of sprite peekRollUp
- set the visible of sprite peekRollUp to 0
- set the castNum of sprite peekRollUp to peekAnim
- setTransition(oPuppeteer, #fadeIn)
- set the inventoryStatus of oPuppeteer to #cool
- updateDisplay(oPuppeteer)
- if gCPU = #PC then
- suspendSounds(#fadeOut)
- end if
- set the loc of sprite peekRollUp to point(317, 189) + gOriginPoint
- set the visible of sprite peekRollUp to 1
- set the movieRate of sprite peekRollUp to 0
- set the movieTime of sprite peekRollUp to 0
- set the volume of sprite peekRollUp to slideVolume
- set the movieRate of sprite peekRollUp to 1
- repeat while the movieTime of sprite peekRollUp < the duration of cast peekAnim
- updateStage()
- end repeat
- set the castNum of sprite peekBody to getProp(the lsForegroundData of oPuppeteer, #PeekUp)
- set camSprite to peekRollUp
- set the loc of sprite camSprite to point(317, 132) + gOriginPoint
- set the castNum of sprite camSprite to getProp(peekVideo, #PkNone)
- puppetSprite(peekText, 1)
- set the stretch of sprite peekText to 0
- set the castNum of sprite peekText to getProp(textList, #None)
- set the loc of sprite peekText to point(317, 226) + gOriginPoint
- puppetSprite(pkScanIcon, 1)
- set the stretch of sprite pkScanIcon to 0
- set the loc of sprite pkScanIcon to buttonCoords
- set currentStatus to getState(oStoryteller, #PKscanStatus)
- if (currentStatus <> #Offline) and (currentStatus <> #CantAttach) then
- set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 3)
- else
- set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 2)
- end if
- puppetSprite(pkBarIcon, 1)
- set the stretch of sprite pkBarIcon to 0
- set the loc of sprite pkBarIcon to buttonCoords
- if getState(oStoryteller, #BarOnline) = 1 then
- set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 3)
- buildDefaultPlaylist()
- else
- set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 2)
- end if
- puppetSprite(pkAmberIcon, 1)
- set the stretch of sprite pkAmberIcon to 0
- set the loc of sprite pkAmberIcon to buttonCoords
- if getState(oStoryteller, #AMBERisOnline) = 1 then
- set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 3)
- else
- set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 2)
- end if
- set hotStuff to getState(oStoryteller, #PeekDisplay)
- setState(oStoryteller, #PeekDisplay, #None)
- if hotStuff = #barStatus then
- if getState(oStoryteller, #BarOnline) then
- mouseDown(script "bar icon --")
- else
- mouseDown(script "scan icon --")
- end if
- end if
- if hotStuff = #scanStatus then
- mouseDown(script "scan icon --")
- end if
- if hotStuff = #amberStatus then
- mouseDown(script "amber icon --")
- end if
- if hotStuff = #psionicFragment then
- hideCursor()
- resetPeeKdisplay()
- set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
- set the castNum of sprite camSprite to getProp(peekVideo, #PkFragment)
- set the movieTime of sprite camSprite to 0
- pushVideo()
- wait(#videoStop)
- if getState(oStoryteller, #houseLightsAreOn) = 1 then
- set the castNum of sprite peekText to getProp(textList, #fragmentCollected)
- else
- set the castNum of sprite peekText to getProp(textList, #psionicFragment)
- end if
- updateStage()
- end if
- if hotStuff = #ghostKnife then
- hideCursor()
- set gPeekPlayList to [#PkFadeIn, #PkKitchenGhost, #PkFadeOut]
- setState(oStoryteller, #PKbarStatus, #ActivityDetected)
- trimState(#cameraFeedbackRemaining, #ghostKnife)
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #ghostlyKey then
- hideCursor()
- set gPeekPlayList to [#PkFadeIn, #PkBedroomGhost, #PkFadeOut]
- setState(oStoryteller, #PKbarStatus, #ActivityDetected)
- trimState(#cameraFeedbackRemaining, #ghostlyKey)
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #crazyLR then
- hideCursor()
- set gPeekPlayList to [#PkFadeIn, #PkCrazyLR, #PkFadeOut]
- setState(oStoryteller, #PKbarStatus, #ActivityDetected)
- trimState(#cameraFeedbackRemaining, #crazyLR)
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #crazyDR then
- hideCursor()
- set gPeekPlayList to [#PkFadeIn, #PkCrazyDR, #PkFadeOut]
- setState(oStoryteller, #PKbarStatus, #ActivityDetected)
- trimState(#cameraFeedbackRemaining, #crazyDR)
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #KdKnob then
- hideCursor()
- set gPeekPlayList to [#PkFadeIn, #PkKdKnob, #PkFadeOut]
- setState(oStoryteller, #PKbarStatus, #ActivityDetected)
- trimState(#cameraFeedbackRemaining, #KdKnob)
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #bloodBath then
- hideCursor()
- set gPeekPlayList to [#PkFadeIn, #PkBloodBath, #PkFadeOut]
- setState(oStoryteller, #PKbarStatus, #ActivityDetected)
- trimState(#cameraFeedbackRemaining, #bloodBath)
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #BARstartup then
- set gPeekPlayList to [#PkNone]
- setState(oStoryteller, #PKbarStatus, #Online)
- mouseDown(script "bar icon --")
- buildDefaultPlaylist()
- wait(90)
- setState(oStoryteller, #PKbarStatus, #noActivity)
- idle()
- mouseDown(script "bar icon --")
- end if
- if hotStuff = #amberStartup then
- cursorOff()
- put "<i> UsePeekUnit(): do that crazy amber-startup stuff..."
- setState(oStoryteller, #PKamberStatus, #ModulatingEEG)
- mouseDown(script "amber icon --")
- updateStage()
- wait(240)
- set the castNum of sprite peekText to getProp(textList, #None)
- updateStage()
- wait(20)
- setState(oStoryteller, #PKamberStatus, #OneMoment)
- updateStage()
- wait(200)
- set the castNum of sprite peekText to getProp(textList, #None)
- updateStage()
- wait(20)
- setState(oStoryteller, #PKamberStatus, #surfsUp)
- updateStage()
- wait(50)
- set the castNum of sprite peekText to getProp(textList, #None)
- updateStage()
- wait(20)
- setState(oStoryteller, #PKamberStatus, #surfsUp)
- updateStage()
- wait(50)
- set the castNum of sprite peekText to getProp(textList, #None)
- updateStage()
- wait(20)
- setState(oStoryteller, #PKamberStatus, #surfsUp)
- updateStage()
- end if
- if hotStuff = #irregularSurface then
- hideCursor()
- setState(oStoryteller, #PKscanStatus, #CantAttach)
- mouseDown(script "scan icon --")
- updateStage()
- wait(120)
- setState(oStoryteller, #PKscanStatus, #Offline)
- mouseDown(script "scan icon --")
- end if
- if hotStuff = #badScan then
- hideCursor()
- if getState(oStoryteller, #DoorWithScanUnit) = #None then
- set currentState to #Offline
- else
- set currentState to #Online
- end if
- setState(oStoryteller, #PKscanStatus, #NoResidue)
- mouseDown(script "scan icon --")
- updateStage()
- wait(170)
- setState(oStoryteller, #PKscanStatus, currentState)
- end if
- if hotStuff = #interruptedScan then
- hideCursor()
- if getState(oStoryteller, #DoorWithScanUnit) = #None then
- set currentState to #Offline
- else
- set currentState to #Online
- end if
- setState(oStoryteller, #PKscanStatus, #Interrupted)
- mouseDown(script "scan icon --")
- updateStage()
- wait(110)
- setState(oStoryteller, #PKscanStatus, currentState)
- end if
- if hotStuff = #goodScan1min then
- hideCursor()
- set finishTime to gScanFinish
- setState(oStoryteller, #PKscanStatus, #Preamble)
- mouseDown(script "scan icon --")
- updateStage()
- wait(70)
- idle()
- setState(oStoryteller, #PKscanStatus, #Wait1min)
- set gScanFinish to finishTime
- mouseDown(script "scan icon --")
- end if
- if hotStuff = #goodScan2min then
- hideCursor()
- set finishTime to gScanFinish
- setState(oStoryteller, #PKscanStatus, #Preamble)
- mouseDown(script "scan icon --")
- updateStage()
- wait(70)
- idle()
- setState(oStoryteller, #PKscanStatus, #Wait2min)
- set gScanFinish to finishTime
- mouseDown(script "scan icon --")
- end if
- if hotStuff = #goodScan3min then
- hideCursor()
- set finishTime to gScanFinish
- setState(oStoryteller, #PKscanStatus, #Preamble)
- mouseDown(script "scan icon --")
- updateStage()
- wait(70)
- idle()
- setState(oStoryteller, #PKscanStatus, #Wait3min)
- set gScanFinish to finishTime
- mouseDown(script "scan icon --")
- end if
- if hotStuff = #goodScan4min then
- hideCursor()
- set finishTime to gScanFinish
- setState(oStoryteller, #PKscanStatus, #Preamble)
- mouseDown(script "scan icon --")
- updateStage()
- wait(70)
- idle()
- setState(oStoryteller, #PKscanStatus, #Wait4min)
- set gScanFinish to finishTime
- mouseDown(script "scan icon --")
- end if
- if hotStuff = #goodScan5min then
- hideCursor()
- set finishTime to gScanFinish
- setState(oStoryteller, #PKscanStatus, #Preamble)
- mouseDown(script "scan icon --")
- updateStage()
- wait(70)
- idle()
- setState(oStoryteller, #PKscanStatus, #Wait5min)
- set gScanFinish to finishTime
- mouseDown(script "scan icon --")
- end if
- end
-
- on hideCursor
- global thisCursor, lastCursor
- set thisCursor to #noCursor
- set lastCursor to thisCursor
- cursorDance(0)
- end
-
- on resetPeeKdisplay
- global oPuppeteer, oStoryteller
- set pkScanIcon to 41
- set pkBarIcon to 42
- set pkAmberIcon to 43
- set camSprite to 44
- set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
- set the castNum of sprite camSprite to getProp(peekVideo, #PkNone)
- set scanStatus to getState(oStoryteller, #PKscanStatus)
- if (scanStatus <> #Offline) and (scanStatus <> #CantAttach) then
- set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 3)
- else
- set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 2)
- end if
- if getState(oStoryteller, #BarOnline) = 1 then
- set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 3)
- else
- set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 2)
- end if
- if getState(oStoryteller, #AMBERisOnline) = 1 then
- set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 3)
- else
- set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 2)
- end if
- updateStage()
- end
-
- on buildDefaultPlaylist
- global gPeekPlayList
- set currentLoc to string(getState(oStoryteller, #currentLocation))
- set whichRoom to getLocationPointer(oPuppeteer, currentLoc, #sublist)
- set gPeekPlayList to [#PkFadeIn, #PkFadeOut]
- if whichRoom <> #office then
- addAt(gPeekPlayList, 2, #PkOffice)
- end if
- if whichRoom <> #Marg then
- addAt(gPeekPlayList, 2, #Pk40s)
- end if
- if whichRoom <> #MBR then
- addAt(gPeekPlayList, 2, #PkMBR)
- end if
- if whichRoom <> #kitchen then
- addAt(gPeekPlayList, 2, #PkKitchen)
- end if
- if whichRoom <> #diningRm then
- addAt(gPeekPlayList, 2, #PkDiningRm)
- end if
- if whichRoom <> #livingRm then
- addAt(gPeekPlayList, 2, #PkLivingRm)
- end if
- if whichRoom <> #Study then
- addAt(gPeekPlayList, 2, #PkStudy)
- end if
- end
-